//
// Created by 123 on 2024/12/26.
//
#include "stdio.h"
#include "stdlib.h"

int main059(){
    int* ptr;
    int n = 5;
    //使用calloc分配内存
   ptr =  (int*)calloc(n,sizeof(int ));
   if(ptr == NULL){
       printf("内存分配失败\n");
       exit(1);
   }
   //输出数组
    for (int i = 0; i < n; ++i) {
        printf("%d ",ptr[i]);
    }
    printf("\n");
    free(ptr);

    return 0;
}